package com.sina.shop.service.carousel;

import com.sina.shop.dao.carousel.CarouselDao;
import com.sina.shop.domain.carousel.Carousel;
import com.sina.shop.service.ShopDataSourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

import static com.sina.shop.service.ServiceConstant.SHOP_TX;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2018-02-06-15:40
 */
@Service("carouselService")
public class CarouselServiceImpl extends ShopDataSourceService implements CarouselService {

    @Autowired
    @Qualifier("carouselDao")
    private CarouselDao carouselDao;

    @Override
    @Transactional(value = SHOP_TX, readOnly = true, isolation = Isolation.READ_COMMITTED)
    public List<Carousel> getCarousel() {
        return carouselDao.getCarousel();
    }
}
